package com.company;

import java.util.Scanner;

public class demo36 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入年份：");
        int year = sc.nextInt();
        System.out.print("请输入月份：");
        int month = sc.nextInt();
        int d = 0;
        switch (month) {
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12: {
                d = 31;
                break;
            }
            case 4:
            case 6:
            case 9:
            case 11: {
                d = 30;
                break;
            }
            case 2: {
                if ((year % 100 != 0 && year % 4 == 0) || (year % 100 == 0 && year % 400 == 0)) {
                    d = 29;
                } else {
                    d = 28;
                }
            }
            default:
                break;
        }
        System.out.println(d);


    }
}
